<?php

namespace App\Http\Requests;

use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Validation\Rule;

class CheckMemberLogin extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {



        return [
            'Member' => ['required'],
            'password' => ['required'],
            'emailCode' => [
                'required',
                Rule::in([session('Captch')]),
            ],
        ];
    }

    public function messages()
    {
        return [
            'name.exists' => '用户不存在',
            'password.required' => '请输入密码',
            'emailCode.required' => '请填写验证码',
            'emailCode.in' => '验证码不正确',
        ];
    }
}
